using System;
using System.Collections.Generic;
using System.Text;

namespace FactoryPattern
{
    class Operation
    {
        private double _NumberA = 0.0d;

        public double NumberA
        {
            get { return _NumberA; }
            set { _NumberA = value; }
        }
        private double _NumberB = 0.0d;

        public double NumberB
        {
            get { return _NumberB; }
            set { _NumberB = value; }
        }

        public virtual double GetResult()
        {
            double result = 0.0d;
            return result;
        }
    }

    class OperationAdd : Operation
    {
        public override double GetResult()
        {
            return this.NumberA + this.NumberB;
        }
    }

    class OperationSub : Operation
    {
        public override double GetResult()
        {
            return this.NumberA - this.NumberB;
        }
    }
}
